import ContextTodo from "../../../store/contextTodo";
import { useContext } from 'react';

const ContextChild2= () => {
  const context = useContext(ContextTodo)
    console.log(8520,context)
    return (<div>
       拿到全局共享的todo数据:
       {
        context.todoList.map((item,index)=>{
            console.log(item)
            return (
            <p>{item.title}</p>
            )
        })
       }
       <button onClick={() => context.updateList({title: '啦啦啦', level: 2})}>添加一條todo</button>
    </div>);
}
 
export default ContextChild2;